<?php
 
include_once("./configure/configure.php");						//--> global var
include_once("./admin/tools/smarty/libs/Smarty.class.php");		//--> out template


$id 		= intval($_POST['id']);
$width 		= intval($_POST['width']);
$height		= intval($_POST['height']);

$fileName	= $_POST['fileName'];
$bgColor	= $_POST['bgColor'];
$type		= $_POST['type'];
$isAddBg	= $_POST['isAddBg'];
if(empty($isAddBg))
	$isAddBg = 0;
	
$url 	= HOME_URL . "/admin/pic/thumbnail.php?type=$type&width=$width&height=$height&isAddBg=$isAddBg&bgColor=$bgColor&fileName=$fileName";

//echo $url;
//exit;

$file 	= fopen($url, "r");

header("Content-Type: application/force-download");
header("Content-Disposition: attachment; filename=$fileName"); 

fpassthru($file);
exit;	

?>
